from PythonUtils.thread.ThreadUtil import ThreadUtil

if __name__ == '__main__':
    import time
    def function():
        while True:
            print('线程启动成功')
            time.sleep(0.5)
    thread = ThreadUtil()
    t = thread.startThread(function)
    time.sleep(3)
    thread.stopThread(t.ident)